module(
    name = "copybara",
    version = "0",
    compatibility_level = 0,
)

bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "blake3", version = "1.5.1.bcr.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
bazel_dep(name = "grpc", version = "1.73.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "grpc-java", version = "1.71.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "protobuf", version = "32.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_cc", version = "0.2.13")
bazel_dep(name = "rules_java", version = "9.0.3")
bazel_dep(name = "rules_jvm_external", version = "6.5")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_shell", version = "0.3.0")

bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "zstd-jni", version = "1.5.6-9")


single_version_override(
    module_name = "rules_jvm_external",
    patch_strip = 1,
    patches = ["//third_party:rules_jvm_external_6.5.patch"],
    version = "6.5",
)


non_module_deps = use_extension("//:repositories.bzl", "non_module_deps")
use_repo(non_module_deps, "io_bazel")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "copybara_maven",
    artifacts = [
        "com.github.stephenc.jcip:jcip-annotations:1.0-1",
        "com.google.auto.service:auto-service-annotations:1.1.1",
        "com.google.auto.service:auto-service:1.1.1",
        "com.google.auto.value:auto-value-annotations:1.11.0",
        "com.google.auto.value:auto-value:1.11.0",
        "com.google.auto:auto-common:1.2.2",
        "com.google.code.findbugs:jsr305:3.0.2",
        "com.google.code.gson:gson:2.10.1",
        "com.google.errorprone:error_prone_type_annotations:2.20.0",
        "com.google.flogger:flogger-system-backend:0.7.4",
        "com.google.flogger:flogger:0.7.4",
        "com.google.flogger:google-extensions:0.7.4",
        "com.google.guava:failureaccess:1.0.3",
        "com.google.guava:guava-testlib:33.4.6-jre",
        "com.google.guava:guava:33.4.6-jre",
        "com.google.http-client:google-http-client-gson:1.43.3",
        "com.google.http-client:google-http-client-test:1.43.3",
        "com.google.http-client:google-http-client:1.43.3",
        "com.google.jimfs:jimfs:1.2",
        "com.google.re2j:re2j:1.7",
        "com.google.testparameterinjector:test-parameter-injector:1.8",
        "com.google.truth.extensions:truth-java8-extension:1.3.0",
        "com.google.truth:truth:1.3.0",
        "com.googlecode.java-diff-utils:diffutils:1.3.0",
        "org.jcommander:jcommander:2.0",
        "com.ryanharter.auto.value:auto-value-gson-extension:1.3.1",
        "com.ryanharter.auto.value:auto-value-gson-factory:1.3.1",
        "com.ryanharter.auto.value:auto-value-gson-runtime:1.3.1",
        "com.sun.mail:javax.mail:1.5.6",
        "commons-codec:commons-codec:1.16.0",
        "it.unimi.dsi:fastutil:7.2.1",
        "junit:junit:4.13.2",
        "net.bytebuddy:byte-buddy-agent:1.14.5",
        "net.bytebuddy:byte-buddy:1.14.5",
        "org.apache.commons:commons-compress:1.25.0",
        "org.apache.tomcat:tomcat-annotations-api:8.0.5",
        "org.apache.velocity:velocity:1.7",
        "org.jsoup:jsoup:1.16.1",
        "org.mockito:mockito-core:4.5.1",
        "org.objenesis:objenesis:1.0",
        "org.tomlj:tomlj:1.1.1",
        "org.tukaani:xz:1.9"
    ],
    fail_if_repin_required = True,
    repositories = [
        "https://repo1.maven.org/maven2",
        "https://maven.google.com",
    ],
)
use_repo(maven, "copybara_maven")

# Copied from bazelbuild/bazel/MODULE.bazel, has to be kept in sync
# TODO(hsudhof): Vendor bazel's starlark package instead
maven.install(
    artifacts = [

        "com.github.ben-manes.caffeine:caffeine:3.0.5",
        "com.github.kevinstern:software-and-algorithms:1.0",
        "com.github.stephenc.jcip:jcip-annotations:1.0-1",
        "com.google.api-client:google-api-client-gson:1.35.2",
        "com.google.api-client:google-api-client:1.35.2",
        "com.google.auth:google-auth-library-credentials:1.24.1",
        "com.google.auth:google-auth-library-oauth2-http:1.6.0",
        "com.google.auto.service:auto-service-annotations:1.0.1",
        "com.google.auto.service:auto-service:1.0",
        "com.google.auto.value:auto-value-annotations:1.11.0",
        "com.google.auto.value:auto-value:1.11.0",
        "com.google.auto:auto-common:1.2.1",
        "com.google.code.findbugs:jsr305:3.0.2",
        "com.google.code.gson:gson:2.11.0",
        "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0",
        "com.google.errorprone:error_prone_annotation:2.30.0",
        "com.google.errorprone:error_prone_annotations:2.30.0",
        "com.google.errorprone:error_prone_check_api:2.30.0",
        "com.google.errorprone:error_prone_core:2.30.0",
        "com.google.errorprone:error_prone_type_annotations:2.30.0",
        "com.google.flogger:flogger-system-backend:0.5.1",
        "com.google.flogger:flogger:0.5.1",
        "com.google.flogger:google-extensions:0.5.1",
        "com.google.guava:failureaccess:1.0.3",
        "com.google.guava:guava:33.4.6-jre",
        "com.google.http-client:google-http-client-gson:1.42.0",
        "com.google.http-client:google-http-client:1.42.0",
        "com.google.j2objc:j2objc-annotations:1.3",
        "com.google.turbine:turbine:0.5.0",
	"com.guardsquare:proguard-base:jar:7.5.0",
        "com.ryanharter.auto.value:auto-value-gson-extension:1.3.1",
        "com.ryanharter.auto.value:auto-value-gson-runtime:1.3.1",
        "com.ryanharter.auto.value:auto-value-gson-factory:1.3.1",
        "com.squareup:javapoet:1.12.0",
        "commons-collections:commons-collections:3.2.2",
        "commons-lang:commons-lang:2.6",
        "io.github.java-diff-utils:java-diff-utils:4.12",
        "io.grpc:grpc-api:1.66.0",
        "io.grpc:grpc-auth:1.66.0",
        "io.grpc:grpc-context:1.66.0",
        "io.grpc:grpc-core:1.66.0",
        "io.grpc:grpc-netty:1.66.0",
        "io.grpc:grpc-protobuf-lite:1.66.0",
        "io.grpc:grpc-protobuf:1.66.0",
        "io.grpc:grpc-stub:1.66.0",
        "io.netty:netty-buffer:4.1.110.Final",
        "io.netty:netty-codec-http2:4.1.110.Final",
        "io.netty:netty-codec-http:4.1.110.Final",
        "io.netty:netty-codec:4.1.110.Final",
        "io.netty:netty-common:4.1.110.Final",
        "io.netty:netty-handler-proxy:4.1.110.Final",
        "io.netty:netty-handler:4.1.110.Final",
        "io.netty:netty-resolver-dns:4.1.110.Final",
        "io.netty:netty-resolver:4.1.110.Final",
        "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.56.Final",
        "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.56.Final",
        "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.56.Final",
        "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.56.Final",
        "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.56.Final",
        "io.netty:netty-tcnative-classes:2.0.56.Final",
        "io.netty:netty-transport-classes-epoll:4.1.93.Final",
        "io.netty:netty-transport-classes-kqueue:4.1.93.Final",
        "io.netty:netty-transport-native-epoll:jar:linux-aarch_64:4.1.93.Final",
        "io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.93.Final",
        "io.netty:netty-transport-native-kqueue:jar:osx-aarch_64:4.1.93.Final",
        "io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.93.Final",
        "io.netty:netty-transport-native-unix-common:4.1.93.Final",
        "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64:4.1.93.Final",
        "io.netty:netty-transport-native-unix-common:jar:linux-x86_64:4.1.93.Final",
        "io.netty:netty-transport-native-unix-common:jar:osx-aarch_64:4.1.93.Final",
        "io.netty:netty-transport-native-unix-common:jar:osx-x86_64:4.1.93.Final",
        "io.netty:netty-transport:4.1.110.Final",
        "io.reactivex.rxjava3:rxjava:3.1.2",
        "it.unimi.dsi:fastutil:7.2.1",
        "javax.activation:javax.activation-api:1.2.0",
        "javax.annotation:javax.annotation-api:1.3.2",
        "javax.inject:javax.inject:1",
        "net.bytebuddy:byte-buddy-agent:1.14.5",
        "net.bytebuddy:byte-buddy:1.14.5",
        "org.apache.commons:commons-compress:1.20",
        "org.apache.commons:commons-pool2:2.8.0",
        "org.apache.tomcat:tomcat-annotations-api:8.0.5",
        "org.apache.velocity:velocity:1.7",
        "org.checkerframework:checker-qual:3.19.0",
        "org.commonmark:commonmark:0.25.0",
        "org.jcommander:jcommander:2.0",
        "org.ow2.asm:asm-analysis:9.2",
        "org.ow2.asm:asm-commons:9.2",
        "org.ow2.asm:asm-tree:9.2",
        "org.ow2.asm:asm-util:9.2",
        "org.ow2.asm:asm:9.2",
        "org.pcollections:pcollections:3.1.4",
        "org.threeten:threeten-extra:1.5.0",
        "org.tukaani:xz:1.9",
        "org.yaml:snakeyaml:1.28",
        # The following jars are for testing.
        # junit is not test only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner,
        # and hamcrest is a dependency of junit.
        "junit:junit:4.13.2",
        "org.hamcrest:hamcrest-core:1.3",
    ],
    excluded_artifacts = [
        # org.apache.httpcomponents and org.eclipse.jgit:org.eclipse.jgit
        # require java.security.jgss module to be embedded in the Bazel binary.
        "org.apache.httpcomponents:httpclient",
        "org.apache.httpcomponents:httpcore",
        "org.eclipse.jgit:org.eclipse.jgit",
        # We build protobuf Java library from source, exclude protobuf jars to be safe.
        "com.google.protobuf:protobuf-java",
        "com.google.protobuf:protobuf-javalite",
    ],
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
    strict_visibility = True,
)

async_profiler_repos = use_extension("//:repositories.bzl", "async_profiler_repos")
use_repo(
    async_profiler_repos,
    "async_profiler",
    "async_profiler_linux_arm64",
    "async_profiler_linux_x64",
    "async_profiler_macos",
)

use_repo(maven, "maven")
